package com.hopes.bizz.close.statistic.controller;

import com.hopes.bizz.close.flow.service.ClosedHazardGoodsStockRecordService;
import com.hopes.bizz.close.statistic.dto.AlarmChartDTO;
import com.hopes.bizz.close.statistic.dto.StockEnterOuterDTO;
import com.hopes.boss.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 危险品库存统计
 * @time 2024/2/16 21:15
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/statistic")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class ClosedGoodsStockStatisticController {


    private final ClosedHazardGoodsStockRecordService closedHazardGoodsStockRecordService;


    @Operation(summary = "危险品出入统计图表", description = "危险品出入统计图表")
    @PostMapping("/goodsEnterOuterChart")
    public R queryGoodsEnterOuterChart(@RequestBody StockEnterOuterDTO stockEnterOuterDTO) {
        return R.ok(closedHazardGoodsStockRecordService.queryGoodsEnterOuterChart(stockEnterOuterDTO));
    }


    @Operation(summary = "危险品出入总量统计图表", description = "危险品出入总量统计图表")
    @PostMapping("/goodsEnterOuterTotalChart")
    public R queryGoodsEnterOuterTotalChart(@RequestBody StockEnterOuterDTO stockEnterOuterDTO) {
        return R.ok(closedHazardGoodsStockRecordService.queryGoodsEnterOuterTotalChart(stockEnterOuterDTO));
    }


    @Operation(summary = "危险品类型出入统计图表", description = "危险品类型出入统计图表")
    @PostMapping("/goodsTypeEnterOuterChart")
    public R queryGoodsTypeEnterOuterChart(@RequestBody StockEnterOuterDTO stockEnterOuterDTO) {
        return R.ok(closedHazardGoodsStockRecordService.queryGoodsTypeEnterOuterChart(stockEnterOuterDTO));
    }


    @Operation(summary = "危险品类型统计图表", description = "危险品类型统计图表")
    @PostMapping("/goodsTypeIndexChart")
    public R queryGoodsTypeIndexChart(@RequestBody StockEnterOuterDTO stockEnterOuterDTO) {
        return R.ok(closedHazardGoodsStockRecordService.queryGoodsTypeIndexChart(stockEnterOuterDTO));
    }

}
